from django.db import models

from app.models import FMUser


class InvitationCode(models.Model):
    sales = models.OneToOneField(FMUser, verbose_name=u'销售')
    code = models.CharField(max_length=15, unique=True, verbose_name=u'邀请码')

    def __str__(self):
        return '[%s - %s]' % (self.sales, self.code)

    class Meta:
        verbose_name = u'邀请码'
        verbose_name_plural = u'邀请码'
